package cn.tedu.spring.di;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Value("彩虹糖！")
    private String serviceName;
    private UserDao userdao;
   /* @Autowired
    public void setUserdao(UserDao userdao) {
        this.userdao = userdao;
    }*/
    @Autowired
    public UserService(UserDao userdao) {
        this.userdao = userdao;
    }

    @Override
    public String toString() {
        return "UserService{" +
                "serviceName='" + serviceName + '\'' +
                ", userdao=" + userdao +
                '}';
    }
}
